package com.example.demo.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class LogController {
    //1.得到日志对象
    private static Logger log= LoggerFactory.getLogger(LogController.class);

    @RequestMapping("/log")
    public void log(){
        String msg="呵呵呵！！！";
        log.trace("trace:"+msg);
        log.debug("debug:"+msg);
        log.info("info:"+msg);
        log.warn("warm:"+msg);
        log.error("error:"+msg);
        //只会打印自己和等级比自己高的日志，默认等级是info
    }
}
